home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Utilities / MView / gxu / d3dx8dbg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-09-27  |  1.6 KB  |  81 lines

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. //  Copyright (C) 1999 Microsoft Corporation.  All Rights Reserved.
  4. //
  5. //  File:       d3dx8dbg.h
  6. //  Content:    D3DX debugging functions
  7. //
  8. ///////////////////////////////////////////////////////////////////////////
  9.  
  10.  
  11. #ifndef __D3DX8DBG_H__
  12. #define __D3DX8DBG_H__
  13.  
  14.  
  15. //
  16. // DPF
  17. //
  18.  
  19. #if DBG
  20.  
  21.     void cdecl D3DXDebugPrintfMView(UINT lvl, LPSTR szFormat, ...);
  22.     void cdecl D3DXDebugPrintfHRMView(UINT lvl, HRESULT hr, LPSTR szFormat, ...);
  23.  
  24.     #define DPF D3DXDebugPrintfMView
  25.     #define DPFHR D3DXDebugPrintfHRMView
  26.  
  27. #else // !DBG
  28.  
  29.     #define DPF
  30.     #define DPFHR
  31.  
  32. #endif // !DBG
  33.  
  34.  
  35.  
  36.  
  37. //
  38. // D3DXASSERT
  39. //
  40.  
  41. #if DBG
  42.  
  43.     int WINAPI D3DXDebugAssertMView(LPCSTR szFile, int nLine, LPCSTR szCondition);
  44.  
  45.     #define D3DXASSERT(condition) \
  46.         do { if(!(condition) && D3DXDebugAssertMView(__FILE__, __LINE__, #condition)) DebugBreak(); } while(0)
  47.  
  48. #else // !DBG
  49.  
  50.     #define D3DXASSERT(condition) 0
  51.  
  52. #endif // !DBG
  53.  
  54.  
  55. //
  56. // Memory leak checking
  57. //
  58. #ifdef DBG
  59. //#define MEM_DEBUG
  60. #endif
  61.  
  62. #ifdef MEM_DEBUG
  63.  
  64.     BOOL WINAPI D3DXDumpUnfreedMemoryInfo();
  65.     void *operator new(size_t stAllocateBlock, const UINT32 uiLineNumber, const char *szFilename);
  66.     void operator delete(void *pvMem, size_t stAllocateBlock, const UINT32 uiLineNumber, const char *szFilename);
  67.     //void operator delete( void *pvMem );
  68.  
  69.  
  70. #define new new(__LINE__, __FILE__)
  71.  
  72. #else // !DBG
  73.  
  74.     BOOL WINAPI D3DXDumpUnfreedMemoryInfo();
  75.  
  76. #define New new
  77.  
  78. #endif // !DBG
  79.  
  80. #endif // __D3DX8DBG_H__
  81.